package com.wyl.server.detail

import com.umeng.socialize.bean.SHARE_MEDIA
import com.umeng.socialize.media.UMImage
import com.wuhenzhizao.titlebar.widget.CommonTitleBar
import com.wyl.base.share.ShareSimpleAdapter
import com.wyl.base.share.showShareUrlDialog
import com.wyl.libbase.base.BindingActivity
import com.wyl.libbase.extend.toast
import com.wyl.server.R
import com.wyl.server.databinding.DetailServiceActivityBinding
import kotlinx.android.synthetic.main.publish_activity.*

class DetailServiceActivity : BindingActivity<DetailServiceActivityBinding>() {
    override fun getLayoutId(): Int = R.layout.detail_service_activity
    override fun initView() {
        titleBar.apply {
            setListener { _, action, _ ->
                when (action) {
                    CommonTitleBar.ACTION_LEFT_BUTTON -> onBackPressed()
                    CommonTitleBar.ACTION_RIGHT_BUTTON -> showShareUrlDialog(
                        "http//:www.baidu.com",
                        "邀请您快快加入吧",
                        UMImage(this@DetailServiceActivity, R.drawable.logo),
                        "",
                        object : ShareSimpleAdapter() {
                            override fun onError(share_media: SHARE_MEDIA, t: Throwable) {
                                super.onError(share_media, t)
                                toast("分享失败")
                            }
                        })
                    else -> {
                    }
                }
            }
        }
    }

    override fun loadData() {

    }

}
